<template>
  <div class="notice-info">
    <van-nav-bar title="公告详情" left-arrow @click-left="onClickLeft" />
    <div class="notice-content">
      <div class="title">{{ info.title }}</div>
      <div class="detail">{{ info.detail }}</div>
      <div class="pic" v-if="info.urlList && info.urlList.length > 0">
        <img :src="item" alt="" v-for="item in info.urlList" :key="item" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: {}
    }
  },
  created() {
    const id = this.$router.history.current.query.id
    this.$http.getNoticeDetail(id).then((res) => {
      if (res.success) {
        this.info = res.model
      }
    })
  },
  methods: {
    onClickLeft() {
      history.back()
    }
  }
}
</script>

<style lang="less" scoped>
.notice-info {
  .notice-content {
      padding: 0.3rem .3rem;
      min-height: calc(100vh - 100px);
      .title {
          text-align: center;
          font-size: .36rem;
          font-weight: bold;
          line-height: .6rem;
      }
      .detail {
          font-size: .3rem;
          line-height: .4rem;
          text-align: justify;
          margin: 0.3rem 0;
      }
      .pic {
          img {
              width: 100%;
              margin-bottom: .3rem;
          }
      }
  }
}
</style>
